package cn.psvmc.cxzapi.mapper.customer;

import cn.psvmc.cxzapi.config.mybatisplus.mapper.MyBaseMapper;
import cn.psvmc.cxzapi.model.customer.TCustomerGoodsCollect;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * 客户商品收藏表 Mapper 接口
 *
 * @Author auto
 * @Date 2024-08-27
 */
public interface TCustomerGoodsCollectMapper extends MyBaseMapper<TCustomerGoodsCollect> {

    //收藏列表
    IPage<Map<String, Object>> listByCustomerId(Page<TCustomerGoodsCollect> iPage, @Param("customerId") Integer customerId);

    //根据客户ID和商品ID查询收藏记录id
    Integer findByCustomerIdAndGoodsId(@Param("customerId") Integer customerId, @Param("goodsId") Integer goodsId);

    //删除收藏记录
    void deleteByCustomerIdAndGoodsId(@Param("customerId") Integer customerId, @Param("goodsId") Integer goodsId);
}
